package com.xgimi.open.skill.datamanager.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xgimi.open.skill.datamanager.domain.entity.IntentSlotDO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author coderzpw.zhang
 * @description 针对表【intent__slot(意图-槽位中间表)】的数据库操作Mapper
 * @createDate 2023-04-11 16:43:38
 * @Entity com.xgimi.open.skill.datamanager.domain.entity.IntentSlotDO
 */
@Mapper
public interface IntentSlotMapper extends BaseMapper<IntentSlotDO> {


    @Delete("<script>"
            + "delete from intent__slot where intent_id in"
            + "<foreach item='intentId' index='index' collection='intentIds'   open='(' separator=',' close=')'>"
            + "#{intentId}"
            + "</foreach>"
            + "</script>")
    boolean physicalDeleteByIntentIds(@Param("intentIds") List<Long> intentIds);

    @Delete("<script>"
            + "delete from intent__slot where slot_id in"
            + "<foreach item='slotId' index='index' collection='slotIds'   open='(' separator=',' close=')'>"
            + "#{slotId}"
            + "</foreach>"
            + "</script>")
    boolean physicalDeleteBySlotIds(@Param("slotIds") List<Long> slotIds);
}




